package top.ffhome.concurrent.beautiful.ch01;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

public class Demo4Test {
    private static final Log log = LogFactory.get();

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            while (!Thread.currentThread().isInterrupted()) {
                log.info("{} hello", Thread.currentThread());
            }
        });

        thread.start();
        Thread.sleep(1000);
        log.info("main thread interrupt thread");
        thread.interrupt();

        thread.join();
        log.info("main is over");
    }
}
